package com.codesuc.aichat.user.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.codesuc.aichat.common.base.BaseEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;

/**
* @Author: ZhangGongMing
* @CreateTime: 2025/09/23 12:56
* @Description: User实体类
* @Version: 1.0
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "user")
@Schema(title = "User对象", description = "用户实体类")
public class User extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
    * 主键ID
    */
    @Schema(name = "主键ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
    * 用户名
    */
    @Schema(name = "用户名")
    private String username;

    /**
    * 密码
    */
    @Schema(name = "密码")
    private String password;

    /**
    * 邮箱
    */
    @Schema(name = "邮箱")
    private String email;

    /**
    * 确认密码（仅用于接收参数，不持久化到数据库）
    */
    @Schema(name = "确认密码")
    @TableField(exist = false)
    private String confirmPassword;

}